package com.opeartion.controller;

import com.opeartion.pojo.FindGoods;
import com.opeartion.pojo.Goods;
import com.opeartion.service.GoodsService;
import com.opeartion.service.impl.GoodsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author sanshi
 * @version 1.0
 * @data 2020/6/5-9:47
 */

@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Autowired
    private GoodsServiceImpl goodsService;

    @GetMapping("/list")
    public List getAllList(){
       return goodsService.goodsList();
    }

    @PostMapping("/findGoods")
    public List<Goods> goodsList(FindGoods findGoods) {
       return goodsService.goodsList(findGoods);
    }

    @PostMapping("/UpdateGood/{status}/{id}")
    public void UpdateGood(int status, int id) {
        goodsService.UpdateGood(status,id);
    }

}
